<!--
 * @Author: chenli 604089679@qq.com
 * @Date: 2022-06-28 10:34:28
 * @LastEditors: chenli 604089679@qq.com
 * @LastEditTime: 2022-06-30 10:10:08
 * @FilePath: \vue3\src\views\onErrorCapturedTest.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <button @click="notAMethod()">Throw</button>
  {{ value11 }}
  <button @click="count()">count++</button>
  <button @click="isReftest()">判断</button>
  <span v-if="value11 % 2 == 0">隐藏不？</span>
</template>
<script>
import {
  onErrorCaptured,
  onMounted,
  onRenderTracked,
  toRef,
  ref,
  reactive,
  onRenderTriggered,
  isRef,
} from "vue";
export default {
  setup() {
    const value11 = ref(0);
    const value12 = 0;

    onErrorCaptured((err) => {
      console.log("onErrorCaptured:" + err);
      return true;
    });

    onRenderTracked((event) => {
      console.log("onRenderTracked状态跟踪组件" + event);
    });

    onRenderTriggered((event) => {
      console.log("onRenderTriggered状态触发组件" + event);
    });
    function count() {
      value11.value++;
      console.log(value11);
    }
    function isReftest() {
      console.log(isRef(value11) + "---" + isRef(value12));
    }
    return {
      count,
      value11,
      isReftest,
    };
  },
};
</script>
